//
//  ActivityDetailAndDetailCell.m
//  shise
//
//  Created by 徐国庆 on 14/12/23.
//  Copyright (c) 2014年 MZP. All rights reserved.
//

#import "ActivityDetailAndDetailCell.h"

@implementation ActivityDetailAndDetailCell

- (void)dealloc
{
    [_userHeadImageView release];
    [_userNameLabel release];
    [_levelImageView release];
    [_levelLabel release];
    [_timeLabel release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.userHeadImageView = [[UIImageView alloc] init];
//        self.userHeadImageView.backgroundColor = [UIColor redColor];
        self.userHeadImageView.layer.masksToBounds = YES;
        self.userHeadImageView.layer.cornerRadius = 10;
        [self.contentView addSubview:self.userHeadImageView];
        [self.userHeadImageView release];
        
        self.userNameLabel = [[UILabel alloc] init];
        self.userNameLabel.font = [UIFont systemFontOfSize:13];
//        self.userNameLabel.alpha = 0.8;
        [self.contentView addSubview:self.userNameLabel];
        [self.userNameLabel release];
        
        self.levelImageView = [[UIImageView alloc] init];
//        self.levelImageView.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:self.levelImageView];
        [self.levelImageView release];
        
        self.levelLabel = [[UILabel alloc] init];
        self.levelLabel.textAlignment = NSTextAlignmentRight;
        self.levelLabel.font = [UIFont systemFontOfSize:10];
        self.levelLabel.alpha = 0.5;
        [self.contentView addSubview:self.levelLabel];
        [self.levelLabel release];
        
        self.timeLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.timeLabel];
        self.timeLabel.font = [UIFont systemFontOfSize:13];
        self.timeLabel.alpha = 0.5;
        [self.timeLabel release];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.userHeadImageView.frame = CGRectMake(15, 10, 25, 25);
//    self.userNameLabel.frame = CGRectMake(25, 5, <#CGFloat width#>, <#CGFloat height#>)
    self.levelLabel.frame = CGRectMake(self.contentView.frame.size.width - 130, 15, 120, 10);
    self.timeLabel.frame = CGRectMake(43, self.contentView.frame.size.height - 23, 120, 20);
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
